package com.zhang.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.catalina.User;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;

/**
 * 主帖实体类
 */

@Data
@NoArgsConstructor
public class MainBean {

    /**主帖编号*/
    private int mainId;
    /**主帖名*/
    private String mainName;
    /**主帖内容*/
    private String mainContent;
    /**发布时间*/
    @JsonFormat(pattern = "yyyy-MM-dd hh-mm-ss")
    private LocalDateTime mainTime = LocalDateTime.now();
    /**回贴数*/
    private int num;
//    /**所属频道*/
//    private ChannelBean channelBean;
    /**发布用户*/
    private UserBean userBean;
    /**所有的回帖*/
    private List<ReplyBean> replyBeans;

    public MainBean(String mainName, String mainContent) {
        this.mainName = mainName;
        this.mainContent = mainContent;
    }

    @Override
    public String toString() {
        return "MainBean{" +
                "mainId=" + mainId +
                ", mainName='" + mainName + '\'' +
                ", mainContent='" + mainContent + '\'' +
                ", mainTime=" + mainTime +
                ", num=" + num +
                ", userBean=" + userBean +
                ", replyBeans=" + replyBeans +
                '}' + "\n";
    }

    public static void main(String[] args) {
        MainBean mainBean = new MainBean();
        System.out.println(mainBean.getMainTime());
    }
}
